﻿using Architecture.Repository.Interface;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Architecture.Domain.Service.CityServices
{
    public class CityService : ICityService
    {
        /// <summary>
        /// 市信息仓储
        /// </summary>
        protected readonly ICityRepository _cityRepository;

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="cityRepository">市信息仓储</param>
        public CityService(ICityRepository cityRepository)
        {
            _cityRepository = cityRepository;
        }

        public async Task<List<City>> GetAllAsync(int provinceId)
        {
            return await _cityRepository.GetAsync(x => x.ProvinceId == provinceId);
        }
    }
}
